# The Tag editor

The Tag editor opens when you click New HMI Tag or Edit HMI Tag in the Tag Browser's context menu. This lets you add and edit tags from editors other than the Tag Database editor.

## To add a tag using the Tag editor

1. In the Tag Browser, right-click in the right pane and select New HMI Tag.
2. Define the new tag by specifying a name, type, and data source. When you choose a tag type and data source, additional input boxes are shown.
3. Click OK to add the tag to the tag database.

## To edit an existing tag

1. Select the tag from the Tag Browser.
2. Right click and select Edit HMI Tag.
3. Make the required changes.
4. Click OK to save the changes to the tag database.

## Options

- Tag
  - Name

    Specify the tag's name. If you are defining a tag within a folder, type the folder name followed by the backslash, then the tag name. The name (including the folder name) can be up to 255 characters long. The name can include letters, numbers, the underscore (_), hyphen or minus sign (-), and back slash (\).

  - Type

    Choose digital, analog, or string. Additional input boxes related to the type are shown.

  - Description

    Type a description of the tag (128 characters maximum). This can be shown as a label in a graphic display.

- Data Source
  - Device

    Choose Device if data for the tag originates from specific memory locations in a programmable controller via direct drivers or an OPC server.

  - Address

    Type the address of the device, or click the Browse button to open the Tag Browser. The list will show all non-HMI tags in the application. (HMI tags cannot reference other HMI tags.) Select a tag in the Tag Browser, and click OK to insert the address in the Address box.

  - Memory

    Choose Memory if data originates from the value table.

    - Retentive. Check this box if you want the tag to retain its value when the application is closed and reopened, or if the run-time terminal is shut down and restarted.
    - Initial Value. For memory tags, type a starting value for the tag.

      Tip: | If you are relying on retentive behavior for some aspect of your application's functionality, make sure you do not run FactoryTalk View Studio at the same time that you run the application file (*.mer). The reason is that while FactoryTalk View Studio has the application open, the Tag server will cache information for HMI tags, with the unexpected result that all memory tags will appear to be retentive. If you shut down FactoryTalk View Studio and then restart the application, only retentive tags will actually retain their values. Any changes to the tag database, either through the editor or through importing a CSV file, will cause retentive tags to reset to their initial values. To assign initial values to device tags, create a macro in the Macros editor. In the macro, specify a list of tags and assign initial values to them. You can run a macro when the project starts and stops, when a graphic display is opened and closed, and when a user logs in and logs out. As well, in the Global Connections dialog box, you can define up to five expressions or tags, each of which can run a corresponding macro.

## See also

About HMI tag names

About HMI tag types

About data sources

Tag Browser

About macros

Set up global connections